<?php
require '../model/Db.php';
$Db = Db::getInstance();
$user_data = $Db->islogin();
if(!$user_data){
	header('Location:/err.php?id=2');
}elseif(!$_POST['cid']){
	header('Location:/err.php?id=4');
}else{
	header('Content-Type:application/json;charset=utf8');
	$flag = $Db->remove([
		table => 'content',
		where => "id = {$_POST['cid']}"
	]);
	echo json_encode([removed => $flag]);
}
